package exam.demo3;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int f = 0;
        for(int i = 2; i <= n; i++) {
            f = (f + m) % i;
            System.out.print(f + " ");
        }

    }
}
